﻿@model ManufacturerModel
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var manufacturerUrl = Url.RouteUrl("Manufacturer", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(manufacturerUrl);
    }
}
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;
<div class="page category-page">
    <div class="panel panel-default form-panel">
        <div class="panel-heading">
            <h3>@Model.Name</h3>
        </div>
        <div class="panel-body">
            @Html.Widget("manufacturerdetails_top")
            @*description*@
            @if (!String.IsNullOrWhiteSpace(Model.Description))
            {
                <div class="manufacturer-description alert alert-info square-box">
                    @Html.Raw(Model.Description)
                </div>
            }
            @Html.Widget("manufacturerdetails_before_featured_products")
            @*featured products*@
            @if (Model.FeaturedProducts.Count > 0)
            {
                <div class="product-grid">
                    <div class="title mid-content-title">
                        <strong>@T("Products.FeaturedProducts")</strong>
                    </div>
                    <div id="carousel-example-generic-homepage-product" class="carousel slide" data-ride="carousel">
                        <div class="carousel-inner">
                            @{
                var ci = 0;
                            }
                            @foreach (var item in Model.FeaturedProducts)
                            {
                                if (ci == 0)
                                {
                                    @:<div class="item active">
                                        @:<div class="row box-products">
                            }
                                else if (ci % 2 == 0)
                                {
                                    @:<div class="item">
                                        @:<div class="row box-products">
                            }

                            <div class="col-lg-6">
                                <div class="offer offer-default text-center">
                                    @Html.Partial("_ProductBox", item)
                                </div>
                            </div>


                                if (ci % 2 == 1)
                                {
                                    @:
                                </div>
                                @:
                            </div>
                            }
                                ci++;
                            }
                            @if (ci % 2 == 1)
                            {
                                @:
                            </div>
                                @:
                            </div>
                        }

                        </div>


                    </div>
                </div>
            }
            @Html.Widget("manufacturerdetails_after_featured_products")
            <div class="row">
                <div class="col-lg-12">
                    <div class="product-selectors clearfix">
                        @*view mode*@
                        @if (Model.PagingFilteringContext.AllowProductViewModeChanging && Model.Products.Count > 0)
                        {
                            <div class="col-md-4 text-center">
                                <div class="row">
                                    <div class="col-md-4 remove_right_padding">
                                        <span>@T("Catalog.ViewMode")</span>
                                    </div>
                                    <div class="col-md-5 remove_left_padding">
                                        @Html.DropDownList("products-viewmode", Model.PagingFilteringContext.AvailableViewModes, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                    </div>
                                </div>
                            </div>
                        }
                        @*sorting*@
                        @if (Model.PagingFilteringContext.AllowProductSorting && Model.Products.Count > 0)
                        {
                            <div class="col-md-4 text-center">
                                <div class="row">
                                    <div class="col-md-4 remove_right_padding">
                                        <span>@T("Catalog.OrderBy")</span>
                                    </div>
                                    <div class="col-md-8 remove_left_padding">
                                        @Html.DropDownList("products-orderby", Model.PagingFilteringContext.AvailableSortOptions, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                    </div>
                                </div>
                            </div>
                        }
                        @*page size*@
                        @if (Model.PagingFilteringContext.AllowCustomersToSelectPageSize && Model.Products.Count > 0)
                        {
                            <div class="col-md-4 text-center">
                                <div class="row">
                                    <div class="col-md-offset-2 col-md-3">
                                        <span>@T("Catalog.PageSize")</span>
                                    </div>
                                    <div class="col-md-3 remove_left_padding remove_right_padding">
                                        @Html.DropDownList("products-pagesize", Model.PagingFilteringContext.PageSizeOptions, new { @class = "form-control dropdown-filter", onchange = "setLocation(this.value);" })
                                    </div>
                                    <div class="col-md-4 remove_left_padding">
                                        <span>@T("Catalog.PageSize.PerPage")</span>
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                </div>
            </div>
            @Html.Widget("manufacturerdetails_before_filters")
            @*filtering*@
            @if (Model.PagingFilteringContext.PriceRangeFilter.Enabled)
            {
                @Html.Partial("_FilterPriceBox", Model.PagingFilteringContext.PriceRangeFilter, new ViewDataDictionary())
            }
            @Html.Widget("manufacturerdetails_before_product_list")
            @*product list*@
            @if (Model.Products.Count > 0)
            {
                if (Model.PagingFilteringContext.ViewMode == "list")
                {
                    @*list mode*@
                    <div class="product-list">
                        @foreach (var product in Model.Products)
                        {
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="offer offer-default">
                                        @Html.Partial("_ProductBox", product)
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                }
                else
                {
                    @*grid mode*@
                    <div class="product-grid">
                        <div class="row">
                            @foreach (var product in Model.Products)
                            {

                                <div class="col-md-4">
                                    <div class="offer offer-default text-center">
                                        @Html.Partial("_ProductBox", product)
                                    </div>
                                </div>

                            }
                        </div>
                    </div>
                }
            }
            <div class="pager">
                @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
            </div>
            @Html.Widget("manufacturerdetails_bottom")
        </div>
    </div>
</div>
